package com.codejie.pms.controller;

import com.codejie.pms.entity.Customer;
import com.codejie.pms.entity.Project;
import com.codejie.pms.entity.Staff;
import com.codejie.pms.entity.StaffKpi;
import com.codejie.pms.service.CustomerService;
import com.codejie.pms.service.ModelManagerService;
import com.codejie.pms.service.StaffKpiService;
import com.codejie.pms.service.StaffService;
import com.codejie.pms.util.DateUtil;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.xssf.streaming.SXSSFRow;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.time.LocalDate;
import java.util.Collection;
import java.util.List;

@Controller
public class NewAdminController {
    @Autowired
    private StaffService staffService;

    @Autowired
    private StaffKpiService staffKpiService;
    @Autowired
    private  ModelManagerService modelManagerService;

    @RequestMapping("/projectIncome")
    public String toProjectIncome(){
        return "/admin/projectIncome";
    }

    @RequestMapping("/totalRevenue")
    public String toTotalRevenue(){
        return "/admin/totalRevenue";
    }

    /**
     * Description 所有项目信息
     */
    @RequestMapping("admin/pro")
    public String projectList(Model model){
        List<Project> project = modelManagerService.projectList();
        model.addAttribute("project",project);
        return "admin/pro";
    }
}
